<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.css">
    <link rel="shortcut icon" href="//cube.elemecdn.com/c/54/38fa90be5da041bbec3945fb82c00png.png">
    <link href="framework/reset.css" rel="stylesheet">
    <link href="framework/icon.css" rel="stylesheet">
    <link href="css/userAddress.css" rel="stylesheet">
    <script src="https://fastly.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="js/pageJump.js"></script>
    <title>我的积分</title>
</head>
<body>

    <div class="wrapper" id="app">
        <!-- header部分 -->
        <header>
            <p>我的积分</p>
        </header>

        <div  class="points-wrapper">
            <h3 class="points-header">剩余积分列表</h3>
            <ol>
                <li v-for="points in pointsList" class="points">
                    <span class="points-left">{{points.remainingPoints}}</span>
                    <span class="points-right">{{points.orderDate}}</span>
                </li>
            </ol>
        </div>
    </div>
    
    <script>
        var path=getRequestPath()
        var app=new Vue({
            el:"#app",
            data:{
                pointsList:[]
            },
            methods:{
                getPointsList:async function(){
                    axios.post(path+"/PointsController/listPointsByUserId",null,{
                        params:{},
                        headers:{ Authorization:this.getAuthorization() }
                    }).then((respon)=>{
                        if(respon.data.code==200){           
                            this.pointsList=respon.data.detail
                        }
                    }).catch((error)=>{
                        console.log(error)
                    })
                },
                getAuthorization:()=>{
                    
                    return window.localStorage.getItem("Auth")
                },
            },
            created(){
                this.getPointsList()
            }
        })
    </script>
</body>
</html>